package com.fm.mapper;

import com.fm.entity.Rule;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2018/7/30 0030.
 */
public interface RuleMapper extends MBaseMapper<Rule, Integer>{
    @Query(value = "select * from ul_rule where (equipment_id = ?1 or equipment_id = 0) and topic_id = ?2 and status = 1", nativeQuery = true)
    List<Rule> selectByEquipment(Integer equipmentId, String topic);
}
